Hi Dan,
Again
you hijacked someone Else's Thread. Please start a new Conversation for
your own new topic.
Regarding:
#1
There is an undocumented variable:
extern
volatile int ThreadActive; // one bit for each thread
That
can be used to check which Threads are Active. Bit zero is the KFLOP
System Thread and should always be active. Another (probably better
approach) might be to set status (ie Virtual Bits) yourself for when tasks begin
and end. There may be some race conditions associated with using this
status. For example you might test and determine a Thread is running, but then
it might terminate before you can tell it to do something.
#2
You can certainly assign a C Program to a button to toggle a bit:
if
(ReadBit(46))
ClearBit(46);
else
SetBit(46);
But
you won't be able to tell the state from the User Button.
#3
Did you push the "Help" button on the screen and read the
description?
Regards
TK
From:
"'Dan' engnerdan@... [DynoMotion]"
<DynoMotion@yahoogroups.com>
To: DynoMotion@yahoogroups.com
Sent: Tuesday, November 11, 2014 8:15
AM
Subject: [DynoMotion] A few
questions
I got a couple quick
questions
1. Is there a way to check
if a thread/program is running from within another C program? Example, if I have
a programming running as thread 1, and I want to check to see if thread 2 is
currently active?
2. Is there a way to watch
for activation of a KmotionCNC user button from within a C programming running
on the KFLOP? Some of my user button functions I want to be toggled, so right
now I have to use two buttons for 1 function (one to set a bit and one to clear
a bit)
3. What are the “key”
values to the left of the user button descriptions on the setup screen. Like the
number 120, 121, 122, 123 in the attached picture?
Thanks,
Dan